package com.zz.shop.service.impl;

import com.zz.shop.dao.ShopProductCommentDao;
import com.zz.shop.domain.ShopProductCommentDO;
import com.zz.shop.service.ShopProductCommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ShopProductCommentServiceImpl implements ShopProductCommentService {

  @Autowired
  ShopProductCommentDao commentDao;
  @Override
  public List<ShopProductCommentDO> getProductComment(String productId) {
    return commentDao.get_product_comment(productId, 8);
  }

  @Override
  public int getProductCommentCount(String productId) {
    return commentDao.get_product_comment_count(productId);
  }

  @Override
  public int getProductGoodCommentCount(String productId) {
    return commentDao.get_product_good_comment_count(productId);
  }
}
